Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Sep 2002
Posts: 1
Lurker
Lurker
Offline
Joined: Sep 2002
Posts: 1
I wrote a little script that sends an e-mail to all moderators when anyone adds or replies to a post. I put it right after the two "INSERT" lines on addpost.php. I realize this may not work on all systems but it seems to do the trick for me:


<?
/* E-mail board moderators to let them know about the post. */
$connection = mysql_connect("localhost","root", "connect") or die("ConnectFailed");
$db = mysql_select_db("ubb_threads", $connection) or die("SelectFailed");
$sql = "SELECT * FROM w3t_Moderators where Mod_Board = "$Board"";
$sql_result = mysql_query($sql, $connection);
while ($row = mysql_fetch_array($sql_result)){
$username = $row["Mod_Username"];
$sql2 = "SELECT * FROM w3t_Users where U_Username = "$username"";
$sql_result2 = mysql_query($sql2, $connection);
$row2 = mysql_fetch_array($sql_result2);
$email_address = $row2["U_Email"];
$mailto = $email_address;
$mailsubject = "UBB Threads Forum Post";
$mailheaders = "FROM: [][email protected]";[/]
$mailbody = "
You have a new post to your UBB Threads forum.
Please check your forum to approve this post:
From: $postername
Subject: $FormSubject
Body: $FormBody
Click here to view UBB Threads forums: http://myserversurl/www/ubb_threads/ubbthreads.php
";
mail($mailto, $mailsubject, $mailbody, $mailheaders);
}
?>

Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
Thank you


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Shock Hosting
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Zarzal
Zarzal
Berlin, Germany
Posts: 808
Joined: July 2001
Forum Statistics
Forums63
Topics37,583
Posts293,955
Members13,824
Most Online151,614
Nov 14th, 2025
Today's Statistics
Currently Online 850
Topics Created 0
Posts Made 0
Users Online 1
Birthdays 27
Top Posters
AllenAyres 21,080
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2026 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260108)